package com.lagou.edu;
import java.io.IOException;

public class LagouServlet extends HttpServlet {
    @Override
    public void doget(Request request, Response response) {
        String str = "<h1>doget2!</h1>";
        try {
            response.outPut(HttpProtocolUtil.getSucceeText(str));
        } catch (IOException e) {
            try {
                response.outPut(HttpProtocolUtil.getFailText());
            } catch (IOException ioException) {
                e.printStackTrace();
            }
        }
    }

    @Override
    public void dopost(Request request, Response response) {
        String str = "<h1>doPost2!</h1>";
        try {
            response.outPut(HttpProtocolUtil.getSucceeText(str));
        } catch (IOException e) {
            try {
                response.outPut(HttpProtocolUtil.getFailText());
            } catch (IOException ioException) {
                e.printStackTrace();
            }
        }
    }

    @Override
    public void init() throws Exception {

    }

    @Override
    public void destory() throws Exception {

    }
}
